import enGB from "./enGB";
import zhCN from "./zhCN";
import mobileENGB from "./mobile/enGB";
import mobileZHCN from "./mobile/zhCN";
import errorENGB from "./error/enGB";
import errorZHCN from "./error/zhCN";

const mergeI18n = (src: any, des: any, mergeKey: string) => {
    const newData = {...src};
    Object.keys(des).forEach((key) => {
        const mergeKeyValue = `${mergeKey}.${key}`;
        newData[mergeKeyValue] = des[key];
    });
    return newData;
};


export default {
    "en-GB": mergeI18n(
        mergeI18n(enGB, mobileENGB, "mobile"),
        errorENGB,
        "error"
    ),
    "zh-CN": mergeI18n(
        mergeI18n(zhCN, mobileZHCN, "mobile"),
        errorZHCN,
        "error"
    )
};
